from ronglian_sms_sdk import SmsSDK
from django.conf import settings


class SendSms:
    def __init__(self):
        self.sdk = SmsSDK(settings.RONGLIAN['accountSid'], settings.RONGLIAN['accountToken'], settings.RONGLIAN['appId'])

    def send_message(self, phone, code):
        try:
            datas = (code,)
            resp = self.sdk.sendMessage('1', phone, datas)
        except Exception as e:
            print(e)


Sendcode = SendSms()
